package com.pets.springboot_petshop.service;

import com.pets.springboot_petshop.entity.DailyProfit;
import com.pets.springboot_petshop.entity.MonthlyProfit;
import com.pets.springboot_petshop.entity.Order;
import com.pets.springboot_petshop.entity.Orderproduct;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.time.LocalDate;
import java.util.List;

/**
 * @Author: wxk
 * @Email: 2089967794@qq.com
 * @Date: 2024/10/15 下午1:41 周二
 * @Description: 订单编号服务接口
 */
public interface OrderService {
    //id查询
 Order select(int id);
    //user_id查询
      List<Order> selectuser_id(int user_id);
    List<Order> selectstatus(String status);
    List<Order> selectOrderByDate(LocalDate date);
    //查询所有
      List<Order> findAll();
    //添加
    int add(Order order);
    //删除
      int delete(int id);
    //修改数据
       int update(Order order);
    //修改状态
    int updatestatus(Order order);
    // 新增订单和订单产品
    Order addOrderWithProducts(Order order, List<Orderproduct> orderProducts);
    int updatetk_status(Order order);
    int adminupdate(Order order);
    List<Order> selectordernumber(int ordernumber);
    int batchUpdateStatus(@Param("array") int[] ids, @Param("status") String status);
    int admindelete(@Param("array") int[] ids);
    List<MonthlyProfit> selectMonthlyProfit(@Param("year") int year);
    List<DailyProfit> selectDailyProfit(@Param("year") int year, @Param("month") int month);
    //每个月的退货率
    List<MonthlyProfit> selectMonthlyRefundRate(@Param("year") int year);
    //年度的退货率
    List<MonthlyProfit> selectAnnualRefundRate(@Param("year") int year);
}
